package com.iknow;

import com.iknow.data.IdentityFlag;
import com.iknow.data.UserType;
import com.iknow.util.StringUtil;
import java.util.ArrayList;
import java.util.List;

public class User
{
  private boolean mBLogin = false;
  private String mDescription;
  private String mEmail;
  private List<IdentityFlag> mFlagList;
  private String mGender;
  private String mImageUrl;
  private String mNick;
  private String mPassword;
  private String mRegisger;
  private String mSignature;
  private String mUID;
  private UserType mUserType;

  public User(UserResponse paramUserResponse)
  {
    this.mUID = paramUserResponse.getJID();
    this.mEmail = paramUserResponse.getEmail();
    this.mNick = paramUserResponse.getNickName();
  }

  public User(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    this.mUID = paramString1;
    this.mEmail = paramString3;
    this.mPassword = paramString2;
    this.mNick = paramString4;
    this.mFlagList = new ArrayList();
    this.mRegisger = "0";
  }

  public boolean IsLogin()
  {
    return this.mBLogin;
  }

  public String UserTypeToString()
  {
    String str;
    if (this.mUserType == null)
      str = "0";
    while (true)
    {
      return str;
      str = this.mUserType.value();
    }
  }

  public void addFlags(IdentityFlag paramIdentityFlag)
  {
    this.mFlagList.add(paramIdentityFlag);
  }

  public boolean bRegistered()
  {
    int i;
    if (this.mRegisger.equalsIgnoreCase("1"))
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }

  public String getEmail()
  {
    return this.mEmail;
  }

  public IdentityFlag getFlagByIndex(int paramInt)
  {
    IdentityFlag localIdentityFlag;
    if ((paramInt < 0) || (paramInt > getFlagCount()))
      localIdentityFlag = (IdentityFlag)this.mFlagList.get(paramInt);
    while (true)
    {
      return localIdentityFlag;
      localIdentityFlag = null;
    }
  }

  public int getFlagCount()
  {
    return this.mFlagList.size();
  }

  public String getGender()
  {
    if (StringUtil.isEmpty(this.mGender))
      this.mGender = "2";
    return this.mGender;
  }

  public String getImageId()
  {
    return this.mImageUrl;
  }

  public String getIntroduction()
  {
    if (StringUtil.isEmpty(this.mDescription))
      this.mDescription = "五好青年";
    return this.mDescription;
  }

  public String getNick()
  {
    return this.mNick;
  }

  public String getPassword()
  {
    return this.mPassword;
  }

  public String getSignature()
  {
    return this.mSignature;
  }

  public String getUID()
  {
    return this.mUID;
  }

  public UserType getUserType()
  {
    return this.mUserType;
  }

  public void setEmail(String paramString)
  {
    this.mEmail = paramString;
  }

  public void setGender(String paramString)
  {
    this.mGender = paramString;
  }

  public void setImgeID(String paramString)
  {
    this.mImageUrl = paramString;
  }

  public void setIntroduction(String paramString)
  {
    this.mDescription = paramString;
  }

  public void setLogin(boolean paramBoolean)
  {
    this.mBLogin = paramBoolean;
  }

  public void setNick(String paramString)
  {
    this.mNick = paramString;
  }

  public void setPassword(String paramString)
  {
    this.mPassword = paramString;
  }

  public void setRegisger(String paramString)
  {
    this.mRegisger = paramString;
  }

  public void setSignature(String paramString)
  {
    this.mSignature = paramString;
  }

  public void setUID(String paramString)
  {
    this.mUID = paramString;
  }

  public void setUserType(String paramString)
  {
    if (StringUtil.isEmpty(paramString))
      this.mUserType = UserType.Normal;
    while (true)
    {
      while (true)
      {
        return;
        if (!(paramString.equalsIgnoreCase("1")))
          break;
        this.mUserType = UserType.Admin;
      }
      this.mUserType = UserType.Normal;
    }
  }
}